public class Animal_Polymorphic_method_call {
    public static void main(String[] args){
        System.out.println("===多态用法===");

        //向上转型
        Animal a1 = new Dog();
        a1.eat();

        Animal a2 = new Cat();
        a2.eat();

        //向下转型
        Dog dog = (Dog) a1;
        dog.lookdoor();
        dog.eat();
    }
}
